package com.voja.mrvica2;

import android.support.v4.app.ActionBarDrawerToggle;
import android.view.View;

public class DrawerToggle extends ActionBarDrawerToggle {

    Index activity;
    
    public DrawerToggle(Index activity) {
        super(
            activity, 
            activity.drawer, 
            R.drawable.ic_drawer,
            R.string.drawer_open, 
            R.string.drawer_close
        );
        
        this.activity = activity;
    }
    
    public void onDrawerClosed(View view) {
        activity.getActionBar().setTitle(activity.appTitle);
        if (activity.inDetails) {
            Index.shareShow();
        }
    }

    public void onDrawerOpened(View drawerView) {
        activity.getActionBar().setTitle(activity.getResources().getString(R.string.drawer_title));
        Index.shareHide();
    }
    
}
